<?php
class model_attendance_adminuserattendancegroup extends gdl_components_basemodel
{

    public function primarykey() {
        return 'id';
    }

    public function tableName() {
        return 'atdc_admin_user_attendance_group';
    }
	
	public function getInfoArg($arrg=[],$field)
    {
		if(empty($arrg)) return false;
		return $this->select($arrg, $field)->items;
    }
	
	//获取当前用户所具备的查看权限
    public function permission($userId) {
	$attendance = $this->getInfoArg(['adminUserId'=>$userId],'attendancegroupId');
       return empty($attendance) ? [0] : array_column($attendance,'attendancegroupId');
    }

}
